package com.vehicle.domains.vo.req.sysPermission;

import com.vehicle.annotations.EnumValue;
import com.vehicle.enums.ActiveEnum;
import com.vehicle.enums.PermissionTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Data
public class UpdatePermissionReq {
    @Schema(name = "id", description = "权限id")
    @NotNull(message = "权限id不能为空")
    private Long id;

    @Schema(name = "permissionName", description = "权限名称")
    @NotEmpty(message = "权限名称不能为空")
    private String permissionName;

    @Schema(name = "permissionCode", description = "权限编码（唯一标识，如：user:add、door:open）")
    @NotEmpty(message = "权限编码不能为空")
    private String permissionCode;

    @Schema(name = "permissionType", description = "权限类型（MENU-菜单、BUTTON-按钮、API-接口）")
    @NotEmpty(message = "权限类型不能为空")
    @EnumValue(enumClass = PermissionTypeEnum.class, message = "权限类型参数必须为MENU/BUTTON/API")
    private String permissionType;

    @Schema(name = "parentId", description = "父权限ID（0表示顶级权限）")
    @NotNull(message = "父权限ID不能为空")
    private Long parentId;

    @Schema(name = "status", description = "权限状态（ACTIVE-启用、INACTIVE-停用）")
    @NotEmpty(message = "权限状态不能为空")
    @EnumValue(enumClass = ActiveEnum.class, message = "权限状态参数必须为ACTIVE/INACTIVE")
    private String status;

    @Schema(name = "orderNum", description = "排序号（数值越小越靠前）")
    private Integer orderNum;
}
